package vek.GUI.Infoview;

import java.util.TimerTask;

/**
 * This class checks if the website loading takes too long, and if it does, terminates the WebsiteLoader thread
 * @author Christian, Michal og Jakob (Hold 1, gruppe 2)
 */
public class WebsiteLoaderChecker extends TimerTask{

    private WebsiteLoader websiteLoader;
    
    public WebsiteLoaderChecker(WebsiteLoader wl)
    {
        websiteLoader = wl;
    }
    
    /**
     * terminates the WebsiteLoader thread by calling the stopThread() method
     */
    @Override
    public void run() {
        if(websiteLoader.isAlive())
        {
            websiteLoader.stopThread();
            System.out.println("websiteloader interruped");
        }
    }
    

}
